package lumis.portal.presentation.core;


import org.apache.wicket.markup.ComponentTag;

/**
 * Represents built-in tags of the layout file feature.
 * 
 * @version $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
 * @since 6.0.0
 */
public class LayoutFileTag extends ComponentTag
{
	private final ILayoutFileComponentFactory componentFactory;

	public LayoutFileTag(ComponentTag tag, ILayoutFileComponentFactory factory)
	{
		super(tag);
		this.componentFactory = factory;
	}

	/**
	 * Returns the factory to be used to generate the component implementation 
	 * for this tag.
	 * @return the factory.
	 * @since 6.0.0
	 */
	public ILayoutFileComponentFactory getComponentFactory()
	{
		return componentFactory;
	}

	@Override
	public LayoutFileTag mutable()
	{
		if (xmlTag.isMutable())
		{
			return this;
		}
		else
		{
			return new LayoutFileTag(super.mutable(), getComponentFactory());
		}
	}	
}
